import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
// 引入svg
import 'virtual:svg-icons-register'
//注册全局组件
import App from './App.vue'
import router, {setAllMiniMenu} from './router'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
import {$setToken} from "@/utils/require";
import SvgIcon from "@/components/SvgIcon/index.vue";
const app = createApp(App)
// 刷新时，检查是否更新token
let token = sessionStorage.getItem("token")
if (token){
    $setToken(token)
}
setAllMiniMenu()
//自动映射svg资源
// const req = require.context("./")
app.use(createPinia())
console.log("导入router")
app.use(router)
app.use(Antd)
app.component('SvgIcon',SvgIcon)


app.mount('#app')
